<template>
	<view class="page-box">
		<uni-cusTitle title=' ' :isIcon='true'></uni-cusTitle>
		<view class="bg-box">
			<image src="/static/mine/bg3.png" mode="scaleToFill"></image>
		</view>

		<view class="content-box">
			<view class="daishiyong">
				<view class="img-box">
					<view class="img">
						<image v-show="true" src="/static/mine/daishiyong.png" mode="aspectFill"></image>
						<image v-show="false" src="/static/mine/yishiyong.png" mode="aspectFill"></image>
						<image v-show="false" src="/static//mine/shixiao.png" mode="aspectFill"></image>
					</view>
					
					<text v-if="typelist == 0">待使用</text>
					<text v-else-if="typelist == 1">已使用</text>
					<text  v-else>已过期</text>
				</view>
				<text class="time">有效期至2024.12.12</text>
			</view>

<!-- 			<view class="info-box">
				<view class="left">
					<view class="big-box">
						<view class="s-box">
							<image class="wh100" :src="detail.imgurl" mode="aspectFill"></image>
						</view>
					</view>
				</view>
				<view class="right">
					<view>天生桥景区优惠券</view>
					<text>满100减50元</text>
				</view>
			</view> -->

			<view class="QR-box">
				<view class="QRimg">
					<image src="../../static/wsy.png" v-if="typelist == 0"></image>
					<image src="../../static/ydh.png" v-else-if="typelist == 1"></image>
					<image src="../../static/ysx.png"  v-else></image>
					<!-- 兑换失效定位图片 -->
					<view class="pos-img" v-if='false'>   
						<image v-show="true" src="/static/mine/dui1.png"></image>  
						<image v-show="false" src="/static/mine/hi1.png"></image>
					</view>
				</view>
				<view class="num-box">
					<text>券码:29813479128374819</text>
					<text class="copy" @click="copyTap">复制</text>
				</view>
			</view>
		</view>

		<view class="s-title">兑换明细</view>
		<view class="detail">
			<view>兑换时间 <text>- -</text> </view>
			<view class="statu-box">兑换状态
				<text v-show="true">未兑换</text>
				<text v-show="false">未兑换</text>
			</view>
		</view>

		<view class="s-title">兑换规则</view>
		<view class="detail" v-html="detail.text"></view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				staticUrl:this.$base.staticUrl,
				detail: {
					imgurl: '/static/top_back.png',
					text: '规则说明规则说明规则说明规则说明规则说明规则说明规则说明规则说明规则说明规则说明规则说明规则说明规则说明规则说明规则说明',
					
				},
				typelist:'',
			}
		},

		onLoad(options) {
		
            this.typelist = options.type
				console.log( this.typelist)
		},
		methods: {
			copyTap() {
				uni.setClipboardData({
					data: '29813479128374819',
					success: function() {
						uni.showToast({
							title: '复制成功',
							icon: 'none'
						})
					}
				});
			}
		}
	}
</script>

<style scoped lang="scss">
	.bg-box {
		width: 100%;
		height: 448rpx;

		image {
			width: 100%
		}
	}

	.content-box {
		position: relative;

		.daishiyong {
			width: 100%;
			height: 120rpx;
			position: absolute;
			top: -160rpx;

			.img-box {
				margin-bottom: 10rpx;
				display: flex;
				justify-content: center;
				align-items: center;
				font-size: 48rpx;
				font-weight: bold;
				color: #FFDD57;

				.img {
					margin-right: 16rpx;
					width: 64rpx;
					height: 64rpx;
					padding-top: 6rpx;

					image {
						width: 100%;
						height: 100%;
					}
				}
			}

			.time {
				display: block;
				width: 100%;
				text-align: center;
				font-size: 26rpx;
				font-weight: bold;
				color: #FFFFFF;
			}
		}

		width: 690rpx;
		background: #FAEDFC;
		border-radius: 80rpx;
		padding-top: 42rpx;
		margin: 0 auto;
		margin-top: -116rpx;
		position: relative;
		z-index: 10;
		background: #fff;

		display: flex;
		flex-direction: column;
		justify-content: center;
		align-items: center;

		.info-box {
			width: 630rpx;
			height: 132rpx;
			padding-bottom: 30rpx;
			display: flex;
			justify-content: space-between;
			align-items: center;
			border-bottom: 2rpx dashed #884FFF;
			position: relative;

			.left {
				width: 160rpx;
				display: flex;
				align-items: center;

				.big-box {
					width: 132rpx;
					height: 132rpx;
					background: #884FFF;
					border-radius: 32rpx;

					.s-box {
						width: 132rpx;
						height: 132rpx;
						border-radius: 32rpx;
						overflow: hidden;
						transform: translate(-5rpx, -5rpx);
					}
				}
			}

			&::before {
				content: '';
				display: block;
				width: 36rpx;
				height: 36rpx;
				background: #FAEDFC;
				border-radius: 50%;
				position: absolute;
				bottom: -18rpx;
				left: -48rpx;
			}

			&::after {
				content: '';
				display: block;
				width: 36rpx;
				height: 36rpx;
				background: #FAEDFC;
				border-radius: 50%;
				position: absolute;
				bottom: -18rpx;
				right: -48rpx;
			}

			.right {
				flex: 1;
				height: 100%;
				padding: 10rpx 0;
				box-sizing: border-box;
				display: flex;
				flex-direction: column;
				justify-content: space-around;
				font-size: 26rpx;
				color: #3A525E;
				font-weight: bold;

				view {
					font-size: 32rpx;
					color: #002A3A;
				}
			}
		}

		.QR-box {
			width: 100%;
			height: 680rpx;
			display: flex;
			flex-direction: column;
			align-items: center;

			.QRimg {
				width: 448rpx;
				height: 448rpx;
				border-radius: 6rpx;
				margin-top: 96rpx;
				margin-bottom: 40rpx;

				image {
					width: 448rpx;
					height: 448rpx;
				}

				position: relative;

				.pos-img {
					width: 448rpx;
					height: 448rpx;
					background: rgba(0,0,0,.7);
					position: absolute;
					top:0;
					left:0;
					display: flex;
					justify-content: center;
					align-items: center;
					image{
						width: 256rpx;
						height: 256rpx;
					}
				}
			}

			.num-box {
				.copy {
					display: inline-block;
					width: 82rpx;
					height: 48rpx;
					background: #F8DEFC;
					border-radius: 25rpx;
					text-align: center;
					line-height: 48rpx;

					font-size: 26rpx;
					color: #884FFF;
					margin-left: 12rpx;
				}
			}
		}
	}

	// 活动说明
	.s-title {
		width: 630rpx;
		display: flex;
		justify-content: flex-start;
		align-items: center;
		height: 52rpx;
		font-size: 36rpx;
		font-weight: bold;
		color: #002A3A;
		margin: 0 auto;
		margin-top: 56rpx;

		&::before {
			content: '';
			display: block;
			width: 6rpx;
			height: 32rpx;
			background: #884FFF;
			border-radius: 4rpx;
			margin-right: 16rpx;
		}
	}

	.detail {
		width: 630rpx;
		margin: 20rpx auto 0;
		font-size: 28rpx;
		color: #3A525E;
		line-height: 23px;
		font-weight: bold;

		view {
			text {
				margin-left: 30rpx;
			}
		}

		.statu-box {
			text {
				font-size: 28rpx;
				font-weight: bold;
				color: #002A3A;
			}
		}
	}
</style>